<?php

foreach(array(
	'APPLICATION_PATH'=>'application','LIBRARY_PATH'=>'library','PUBLIC_PATH'=>'public'
) as $k => $v){
	defined($k) || define($k, realpath(dirname(__FILE__) . '/../'.$v));
}

defined('APPLICATION_ENV') || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));

set_include_path(implode(PATH_SEPARATOR, array(
	realpath(LIBRARY_PATH),	
	realpath(APPLICATION_PATH.'/models/'),
	get_include_path(),
)));

require_once 'Zend/Loader/Autoloader.php';
Zend_Loader_Autoloader::getInstance()->setFallbackAutoloader(true);

$app = new Zend_Application(APPLICATION_ENV,APPLICATION_PATH . '/configs/application.ini');
$app->bootstrap();
$app->run();